<?php
require_once './include/common.inc.php';
require_once './include/admin.inc.php';
require_once './include/image.func.php';
$filename = $file_uploadfile['name'];
if(!ispicture($filename)) debug($lan['pictureexterror'], 1, 1);
$newfilename = get_upload_filename($filename, 0, 0, 'image');
uploadfile($file_uploadfile['tmp_name'], FORE_ROOT.$newfilename);
$modules = getcache('modules');
operateuploadpicture(FORE_ROOT.$newfilename, $modules[$cookie_lastmoduleid]);
$picurl = $homepage.$newfilename;
?>
<script>
parent.document.getElementById("txtUrl").value = "<?php echo $picurl;?>";
parent.document.getElementById("preview").src = "<?php echo $picurl;?>";
</script>